package com.example.administrator.zkdemo;

import android.app.AlarmManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.YuvImage;
import android.hardware.Camera;
import android.media.AudioManager;
import android.net.EthernetManager;
import android.net.IEthernetManager;
import android.net.IEthernetManager.Stub;
import android.net.IpConfiguration;
import android.net.IpConfiguration.IpAssignment;
import android.net.IpConfiguration.ProxySettings;
import android.net.LinkAddress;
import android.net.NetworkUtils;
import android.net.StaticIpConfiguration;
import android.net.Uri;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.SurfaceControl;
import android.view.WindowManager;

import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Calendar;
import java.util.Enumeration;
import java.util.Locale;
import java.util.regex.Pattern;

/**
 * Created with Android Studio.
 * 描述: ${DESCRIPTION}
 * Date: 2018/11/19
 * Time: 16:49
 *
 * @author 晏琦云
 * @version ${VERSION}
 */
public class SmdtManager {
    private static File COMMAND_FILE;
    private static File LOG_FILE;
    private static File RECOVERY_DIR = new File("/cache/recovery");
    public static final String TAG = "SmdtManager";
    private EthernetManager ethernetManager;
    private Context mContext;
    private Display mDisplay;
    private Matrix mDisplayMatrix;
    private DisplayMetrics mDisplayMetrics;
    private EthernetManager mEthManager;
    private IEthernetManager mIEthernetService;
    private IpConfiguration mIpConfiguration;
    private Bitmap mScreenBitmap;
    ISmdtManager mService;
    private StaticIpConfiguration mStaticIpConfiguration;
    private WindowManager mWindowManager;
    private Calendar mycalendar;
    private SmdtManager smdtManager;

    static {
        COMMAND_FILE = new File(RECOVERY_DIR, "command");
        LOG_FILE = new File(RECOVERY_DIR, "log");
    }

    public SmdtManager(ISmdtManager paramISmdtManager) {
        this.mService = ISmdtManager.Stub.asInterface(ServiceManager.getService("smdt"));
    }

    public SmdtManager(ISmdtManager paramISmdtManager, Context paramContext) {
        this.mService = ISmdtManager.Stub.asInterface(ServiceManager.getService("smdt"));
        this.mContext = paramContext;
    }

    public SmdtManager(Context paramContext) {
        this.mContext = paramContext;
        this.mService = ISmdtManager.Stub.asInterface(ServiceManager.getService("smdt"));
    }

    private static void bootCommand(Context paramContext, String[] paramArrayOfString)
            throws IOException {
        RECOVERY_DIR.mkdirs();
        COMMAND_FILE.delete();
        LOG_FILE.delete();
        FileWriter localFileWriter = new FileWriter(COMMAND_FILE);
        try {
            int j = paramArrayOfString.length;
            int i = 0;
            while (i < j) {
                String str = paramArrayOfString[i];
                if (!TextUtils.isEmpty(str)) {
                    localFileWriter.write(str);
                    localFileWriter.write("\n");
                }
                i += 1;
            }
            localFileWriter.close();
            ((PowerManager) paramContext.getSystemService("power")).reboot("recovery");
            throw new IOException("Reboot failed (no permissions?)");
        } finally {
            localFileWriter.close();
        }
        throw paramContext;
    }

    public static SmdtManager create(Context paramContext) {
        paramContext = new SmdtManager(paramContext);
        if (paramContext.mService != null)
            return paramContext;
        return null;
    }

    // ERROR //
    private String executer(String paramString) {
        // Byte code:
        //   0: new 145	java/lang/StringBuffer
        //   3: dup
        //   4: invokespecial 146	java/lang/StringBuffer:<init>	()V
        //   7: astore 7
        //   9: aconst_null
        //   10: astore 4
        //   12: aconst_null
        //   13: astore 6
        //   15: invokestatic 152	java/lang/Runtime:getRuntime	()Ljava/lang/Runtime;
        //   18: ldc 154
        //   20: invokevirtual 158	java/lang/Runtime:exec	(Ljava/lang/String;)Ljava/lang/Process;
        //   23: astore_2
        //   24: aload_2
        //   25: astore_3
        //   26: new 160	java/io/DataOutputStream
        //   29: dup
        //   30: aload_2
        //   31: invokevirtual 166	java/lang/Process:getOutputStream	()Ljava/io/OutputStream;
        //   34: invokespecial 169	java/io/DataOutputStream:<init>	(Ljava/io/OutputStream;)V
        //   37: astore 5
        //   39: new 171	java/lang/StringBuilder
        //   42: dup
        //   43: invokespecial 172	java/lang/StringBuilder:<init>	()V
        //   46: astore_3
        //   47: aload_3
        //   48: aload_1
        //   49: invokevirtual 176	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   52: pop
        //   53: aload_3
        //   54: ldc 113
        //   56: invokevirtual 176	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   59: pop
        //   60: aload 5
        //   62: aload_3
        //   63: invokevirtual 180	java/lang/StringBuilder:toString	()Ljava/lang/String;
        //   66: invokevirtual 183	java/io/DataOutputStream:writeBytes	(Ljava/lang/String;)V
        //   69: aload 5
        //   71: ldc 185
        //   73: invokevirtual 183	java/io/DataOutputStream:writeBytes	(Ljava/lang/String;)V
        //   76: aload 5
        //   78: invokevirtual 188	java/io/DataOutputStream:flush	()V
        //   81: aload_2
        //   82: invokevirtual 192	java/lang/Process:waitFor	()I
        //   85: pop
        //   86: new 194	java/io/BufferedReader
        //   89: dup
        //   90: new 196	java/io/InputStreamReader
        //   93: dup
        //   94: aload_2
        //   95: invokevirtual 200	java/lang/Process:getInputStream	()Ljava/io/InputStream;
        //   98: invokespecial 203	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;)V
        //   101: invokespecial 206	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
        //   104: astore_1
        //   105: aload_1
        //   106: invokevirtual 209	java/io/BufferedReader:readLine	()Ljava/lang/String;
        //   109: astore_3
        //   110: aload_3
        //   111: ifnull +41 -> 152
        //   114: new 171	java/lang/StringBuilder
        //   117: dup
        //   118: invokespecial 172	java/lang/StringBuilder:<init>	()V
        //   121: astore 4
        //   123: aload 4
        //   125: aload_3
        //   126: invokevirtual 176	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   129: pop
        //   130: aload 4
        //   132: ldc 113
        //   134: invokevirtual 176	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   137: pop
        //   138: aload 7
        //   140: aload 4
        //   142: invokevirtual 180	java/lang/StringBuilder:toString	()Ljava/lang/String;
        //   145: invokevirtual 212	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
        //   148: pop
        //   149: goto -44 -> 105
        //   152: aload 5
        //   154: ifnull +8 -> 162
        //   157: aload 5
        //   159: invokevirtual 213	java/io/DataOutputStream:close	()V
        //   162: aload_2
        //   163: ifnull +88 -> 251
        //   166: aload_2
        //   167: invokevirtual 216	java/lang/Process:destroy	()V
        //   170: goto +81 -> 251
        //   173: astore 4
        //   175: aload 5
        //   177: astore_1
        //   178: goto +91 -> 269
        //   181: astore_3
        //   182: aload 5
        //   184: astore_1
        //   185: aload_3
        //   186: astore 5
        //   188: goto +27 -> 215
        //   191: astore 5
        //   193: aload 6
        //   195: astore_1
        //   196: goto +19 -> 215
        //   199: astore 4
        //   201: aconst_null
        //   202: astore_2
        //   203: aload_2
        //   204: astore_1
        //   205: goto +64 -> 269
        //   208: astore 5
        //   210: aconst_null
        //   211: astore_2
        //   212: aload 6
        //   214: astore_1
        //   215: aload_1
        //   216: astore 4
        //   218: aload_2
        //   219: astore_3
        //   220: aload 5
        //   222: invokevirtual 219	java/lang/Exception:printStackTrace	()V
        //   225: aload_1
        //   226: ifnull +10 -> 236
        //   229: aload_1
        //   230: invokevirtual 213	java/io/DataOutputStream:close	()V
        //   233: goto +3 -> 236
        //   236: aload_2
        //   237: ifnull +14 -> 251
        //   240: aload_2
        //   241: invokevirtual 216	java/lang/Process:destroy	()V
        //   244: goto +7 -> 251
        //   247: aload_1
        //   248: invokevirtual 219	java/lang/Exception:printStackTrace	()V
        //   251: aload 7
        //   253: invokevirtual 220	java/lang/StringBuffer:toString	()Ljava/lang/String;
        //   256: invokevirtual 225	java/lang/String:trim	()Ljava/lang/String;
        //   259: areturn
        //   260: astore_2
        //   261: aload 4
        //   263: astore_1
        //   264: aload_2
        //   265: astore 4
        //   267: aload_3
        //   268: astore_2
        //   269: aload_1
        //   270: ifnull +10 -> 280
        //   273: aload_1
        //   274: invokevirtual 213	java/io/DataOutputStream:close	()V
        //   277: goto +3 -> 280
        //   280: aload_2
        //   281: ifnull +14 -> 295
        //   284: aload_2
        //   285: invokevirtual 216	java/lang/Process:destroy	()V
        //   288: goto +7 -> 295
        //   291: aload_1
        //   292: invokevirtual 219	java/lang/Exception:printStackTrace	()V
        //   295: aload 4
        //   297: athrow
        //   298: astore_1
        //   299: goto -52 -> 247
        //   302: astore_1
        //   303: goto -12 -> 291
        //
        // Exception table:
        //   from	to	target	type
        //   39	105	173	finally
        //   105	110	173	finally
        //   114	149	173	finally
        //   39	105	181	java/lang/Exception
        //   105	110	181	java/lang/Exception
        //   114	149	181	java/lang/Exception
        //   26	39	191	java/lang/Exception
        //   15	24	199	finally
        //   15	24	208	java/lang/Exception
        //   26	39	260	finally
        //   220	225	260	finally
        //   157	162	298	java/lang/Exception
        //   166	170	298	java/lang/Exception
        //   229	233	298	java/lang/Exception
        //   240	244	298	java/lang/Exception
        //   273	277	302	java/lang/Exception
        //   284	288	302	java/lang/Exception
    }

    private static native void exit(int paramInt);

    public static native int getControl(int paramInt);

    private float getDegreesForRotation(int paramInt) {
        switch (paramInt) {
            default:
                return 0.0F;
            case 3:
                return 90.0F;
            case 2:
                return 180.0F;
            case 1:
        }
        return 270.0F;
    }

    private Inet4Address getIPv4Address(String paramString) {
        try {
            paramString = (Inet4Address) NetworkUtils.numericToInetAddress(paramString);
            return paramString;
            label10:
            return null;
        } catch (java.lang.ClassCastException paramString) {
            break label10;
        }
    }

    public static native int getLcdLight();

    private static native int getfwver(int paramInt);

    private static native int getpwmrate();

    private static native int getpwmratio();

    private static native int ioctlDIR(int paramInt);

    private static native int ioctlR();

    private static native int ioctlW(int paramInt);

    private static String loadFileAsString(String paramString)
            throws IOException {
        StringBuffer localStringBuffer = new StringBuffer(1000);
        paramString = new BufferedReader(new FileReader(paramString));
        char[] arrayOfChar = new char[1024];
        while (true) {
            int i = paramString.read(arrayOfChar);
            if (i == -1)
                break;
            localStringBuffer.append(String.valueOf(arrayOfChar, 0, i));
        }
        paramString.close();
        return localStringBuffer.toString();
    }

    private static native long lseek(int paramInt1, long paramLong, int paramInt2);

    private int maskStr2InetMask(String paramString) {
        if (!Pattern.compile("(^((\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])$)|^(\\d|[1-2]\\d|3[0-2])$").matcher(paramString).matches()) {
            Log.e("SmdtManager", "subMask is error");
            return 0;
        }
        paramString = paramString.split("\\.");
        int i = 0;
        int j = i;
        while (i < paramString.length) {
            String str = new StringBuffer(Integer.toBinaryString(Integer.parseInt(paramString[i]))).reverse().toString();
            int m = 0;
            int k = m;
            while (m < str.length()) {
                m = str.indexOf("1", m);
                if (m == -1)
                    break;
                k += 1;
                m += 1;
            }
            j += k;
            i += 1;
        }
        return j;
    }

    private static native int mcusetcmd(char paramChar1, char paramChar2, int paramInt);

    private static native int open();

    private static native int poweronoff(char paramChar1, char paramChar2, char paramChar3, char paramChar4, char paramChar5);

    private static native String read(int paramInt1, int paramInt2);

    public static native byte[] readEeprom(int paramInt1, int paramInt2, int paramInt3, int paramInt4);

    public static native int readGpioValue(int paramInt);

    public static native int setBackLight(int paramInt);

    public static native int setControl(int paramInt1, int paramInt2);

    public static native int setGpioValue(int paramInt1, int paramInt2);

    public static native int setUSBPower(int paramInt1, int paramInt2, int paramInt3);

    private static native int setpwmreg(int paramInt, char paramChar);

    private static native String version();

    public static native int watchDogEnable(char paramChar);

    public static native int watchDogFeed();

    private static native int write(int paramInt, byte[] paramArrayOfByte);

    public static native int writeEeprom(int paramInt1, int paramInt2, int paramInt3, int paramInt4, byte[] paramArrayOfByte);

    public void execSuCmd(String paramString) {
        try {
            this.mService.execSuCmd(paramString);
            return;
            label11:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return;
        } catch (RemoteException paramString) {
            break label11;
        }
    }

    public String getAndroidBoardType() {
        try {
            String str = this.mService.getAndroidBoardType();
            return str;
            label12:
            return null;
        } catch (RemoteException localRemoteException) {
            break label12;
        }
    }

    public String getAndroidDisplay() {
        return SystemProperties.get("ro.build.display.id", null);
    }

    public String getAndroidModel() {
        return SystemProperties.get("ro.product.model", null);
    }

    public String getAndroidVersion() {
        return SystemProperties.get("ro.build.version.release", null);
    }

    public String getApiplatformVersion() {
        return SystemProperties.get("ro.api.platform.version", null);
    }

    public String getCurrentNetType() {
        try {
            String str = this.mService.getCurrentNetType();
            return str;
            label12:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return null;
        } catch (RemoteException localRemoteException) {
            break label12;
        }
    }

    public String getFirmwareVersion() {
        return SystemProperties.get("ro.product.firmware", null);
    }

    public String getFormattedKernelVersion() {
        try {
            String str = this.mService.getFormattedKernelVersion();
            return str;
            label12:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return null;
        } catch (RemoteException localRemoteException) {
            break label12;
        }
    }

    public int getHdmiinStatus() {
        try {
            StringBuilder localStringBuilder = new StringBuilder();
            localStringBuilder.append("cat ");
            localStringBuilder.append("/sys/class/hdmiin_reg/hdmiin_status");
            int i = Integer.parseInt(executer(localStringBuilder.toString()));
            return i;
            label38:
            Log.e("SmdtManager", "[getScreenNumber] Exception");
            return 0;
        } catch (Exception localException) {
            break label38;
        }
    }

    public String getInternalStorageMemory() {
        try {
            String str = this.mService.getInternalStorageMemory();
            return str;
            label12:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return null;
        } catch (RemoteException localRemoteException) {
            break label12;
        }
    }

    public LogcatFileManager getLogcatInterface() {
        return LogcatFileManager.getInstance();
    }

    public String getMCUVersion() {
        try {
            String str = this.mService.getMCUVersion();
            return str;
            label12:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return null;
        } catch (RemoteException localRemoteException) {
            break label12;
        }
    }

    public int getPreviewDegree(Context paramContext) {
        int j = ((WindowManager) paramContext.getSystemService("window")).getDefaultDisplay().getRotation();
        int i = 0;
        switch (j) {
            default:
                return 0;
            case 3:
                return 180;
            case 2:
                return 270;
            case 0:
                i = 90;
            case 1:
        }
        return i;
    }

    public String getRunningMemory() {
        try {
            String str = this.mService.getRunningMemory();
            return str;
            label12:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return null;
        } catch (RemoteException localRemoteException) {
            break label12;
        }
    }

    public int getScreenBrightness(Context paramContext) {
        try {
            int i = Settings.System.getInt(paramContext.getContentResolver(), "screen_brightness");
            return i;
        } catch (Settings.SettingNotFoundException paramContext) {
            paramContext.printStackTrace();
        }
        return 0;
    }

    public int getScreenNumber() {
        try {
            StringBuilder localStringBuilder = new StringBuilder();
            localStringBuilder.append("cat ");
            localStringBuilder.append("/sys/class/param/smdt_param/screen_number");
            int i = Integer.parseInt(executer(localStringBuilder.toString()));
            return i;
            label38:
            Log.e("SmdtManager", "[getScreenNumber] Exception");
            return 0;
        } catch (Exception localException) {
            break label38;
        }
    }

    public String getUartPath(String paramString) {
        try {
            paramString = this.mService.getUartPath(paramString);
            return paramString;
            label13:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return null;
        } catch (RemoteException paramString) {
            break label13;
        }
    }

    public WifiUtils getWifiInterface(Context paramContext) {
        return new WifiUtils(paramContext);
    }

    public String interMask2String(int paramInt) {
        int k = paramInt / 8;
        int j = 0;
        int i = 8;
        while (i > 8 - paramInt % 8) {
            j += (int) Math.pow(2.0D, i - 1);
            i -= 1;
        }
        StringBuilder localStringBuilder;
        if (k == 0) {
            localStringBuilder = new StringBuilder();
            localStringBuilder.append(j);
            localStringBuilder.append(".0.0.0");
            return localStringBuilder.toString();
        }
        if (k == 1) {
            localStringBuilder = new StringBuilder();
            localStringBuilder.append("255.");
            localStringBuilder.append(j);
            localStringBuilder.append(".0.0");
            return localStringBuilder.toString();
        }
        if (k == 2) {
            localStringBuilder = new StringBuilder();
            localStringBuilder.append("255.255.");
            localStringBuilder.append(j);
            localStringBuilder.append(".0");
            return localStringBuilder.toString();
        }
        if (k == 3) {
            localStringBuilder = new StringBuilder();
            localStringBuilder.append("255.255.255.");
            localStringBuilder.append(j);
            return localStringBuilder.toString();
        }
        if (k == 4)
            return "255.255.255.255";
        return null;
    }

    public Bitmap onPreview(byte[] paramArrayOfByte, Camera paramCamera) {
        paramCamera = paramCamera.getParameters().getPreviewSize();
        int i = paramCamera.width;
        int j = paramCamera.height;
        paramCamera = new YuvImage(paramArrayOfByte, 17, i, j, null);
        paramArrayOfByte = new ByteArrayOutputStream(paramArrayOfByte.length);
        if (!paramCamera.compressToJpeg(new Rect(0, 0, i, j), 100, paramArrayOfByte))
            return null;
        paramArrayOfByte = paramArrayOfByte.toByteArray();
        return BitmapFactory.decodeByteArray(paramArrayOfByte, 0, paramArrayOfByte.length);
    }

    public void setBrightness(ContentResolver paramContentResolver, int paramInt) {
        Uri localUri = Settings.System.getUriFor("screen_brightness");
        Settings.System.putInt(paramContentResolver, "screen_brightness", paramInt);
        paramContentResolver.notifyChange(localUri, null);
    }

    public boolean setHdmiInAudioEnable(Context paramContext, boolean paramBoolean) {
        try {
            paramContext = (AudioManager) paramContext.getSystemService("audio");
            if (paramBoolean)
                paramContext.setParameters("HDMIin_enable=true");
            else
                paramContext.setParameters("HDMIin_enable=false");
            return true;
            label34:
            Log.e("SmdtManager", "[setHdmiInAudioEnable] Exception");
            return false;
        } catch (Exception paramContext) {
            break label34;
        }
    }

    public int setHeadsetMicOnOff(int paramInt) {
        if ((paramInt != 0) && (paramInt != 1)) ;
        while (true) {
            try {
                Log.e("SmdtManager", "[getValue] value is not 0 ro 1");
                continue;
                Object localObject = new StringBuilder();
                ((StringBuilder) localObject).append("cat ");
                ((StringBuilder) localObject).append("/sys/devices/ff660000.i2c/i2c-2/2-001c/mic_status");
                paramInt = Integer.parseInt(executer(((StringBuilder) localObject).toString()));
                localObject = new StringBuilder();
                ((StringBuilder) localObject).append("echo \"");
                ((StringBuilder) localObject).append(i);
                ((StringBuilder) localObject).append("\"");
                ((StringBuilder) localObject).append(" > ");
                ((StringBuilder) localObject).append("/sys/devices/ff660000.i2c/i2c-2/2-001c/mic_status");
                localObject = ((StringBuilder) localObject).toString();
                if ((paramInt == 1) || (paramInt == 2))
                    continue;
                Log.e("SmdtManager", "[getValue] result is not 1 ro 2");
                continue;
                executer((String) localObject);
                continue;
                Log.e("SmdtManager", "[getValue] Exception");
                return 0;
            } catch (Exception localException) {
                continue;
            }
            int i = paramInt;
            if (paramInt != 0)
                continue;
            i = 2;
        }
    }

    public void setPowerOffOnAlarm(String paramString1, String paramString2) {
        try {
            this.mService.setPowerOffOnAlarm(paramString1, paramString2);
            return;
            label12:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return;
        } catch (RemoteException paramString1) {
            break label12;
        }
    }

    public void setRotation(String paramString) {
        try {
            this.mService.setRotation(paramString);
            return;
            label11:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return;
        } catch (RemoteException paramString) {
            break label11;
        }
    }

    public int setTime(Context paramContext, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5) {
        if ((paramInt2 == 2) && (paramInt3 == 30))
            return -1;
        Calendar localCalendar = Calendar.getInstance();
        localCalendar.set(1, paramInt1);
        localCalendar.set(2, paramInt2 - 1);
        localCalendar.set(5, paramInt3);
        localCalendar.set(11, paramInt4);
        localCalendar.set(12, paramInt5);
        ((AlarmManager) paramContext.getSystemService("alarm")).setTime(localCalendar.getTimeInMillis());
        return 1;
    }

    public boolean setTimeFromNetwork(boolean paramBoolean, Context paramContext) {
        if (paramBoolean) {
            Settings.Global.putInt(paramContext.getContentResolver(), "auto_time", 1);
            return true;
        }
        Settings.Global.putInt(paramContext.getContentResolver(), "auto_time", 0);
        return false;
    }

    public void setVolumeStates(int paramInt) {
        try {
            this.mService.setVolumeStates(paramInt);
            return;
            label11:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return;
        } catch (RemoteException localRemoteException) {
            break label11;
        }
    }

    public void shutDown() {
        try {
            this.mService.shutdown();
            return;
            label10:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return;
        } catch (RemoteException localRemoteException) {
            break label10;
        }
    }

    public void smdtExit(int paramInt) {
        exit(paramInt);
    }

    public String smdtGetAPIVersion() {
        return "rk3288-V1-20170103";
    }

    public int smdtGetControlStatus(int paramInt) {
        if ((paramInt > 2) && (paramInt < 17))
            return getControl(paramInt);
        return -1;
    }

    public String smdtGetEthIPAddress() {
        try {
            while (true) {
                Object localObject = NetworkInterface.getNetworkInterfaces();
                while (true)
                    if (((Enumeration) localObject).hasMoreElements()) {
                        Enumeration localEnumeration = ((NetworkInterface) ((Enumeration) localObject).nextElement()).getInetAddresses();
                        if (!localEnumeration.hasMoreElements())
                            continue;
                        InetAddress localInetAddress = (InetAddress) localEnumeration.nextElement();
                        if ((localInetAddress.isLoopbackAddress()) || (localInetAddress.isLinkLocalAddress()))
                            break;
                        localObject = localInetAddress.getHostAddress().toString();
                        return localObject;
                    }
            }
        } catch (SocketException localSocketException) {
            Log.e("WifiPreference IpAddress", localSocketException.toString());
        }
        return (String) null;
    }

    public String smdtGetEthMacAddress() {
        try {
            String str = loadFileAsString("/sys/class/net/eth0/address").toUpperCase().substring(0, 17);
            return str;
        } catch (IOException localIOException) {
            localIOException.printStackTrace();
        }
        return null;
    }

    public boolean smdtGetEthernetState() {
        IBinder localIBinder = ServiceManager.getService("ethernet");
        if (this.mIEthernetService == null)
            this.mIEthernetService = IEthernetManager.Stub.asInterface(localIBinder);
        if (this.ethernetManager == null)
            this.ethernetManager = new EthernetManager(this.mContext, this.mIEthernetService);
        return this.ethernetManager.getEthernetConnectState() == 2;
    }

    public int smdtGetLcdLightStatus() {
        return getLcdLight();
    }

    public int smdtGetPwmRate() {
        return getpwmrate();
    }

    public int smdtGetPwmRatio() {
        return getpwmratio();
    }

    public String smdtGetSDcardPath(Context paramContext) {
        try {
            paramContext = this.mService.smdtGetSDcardPath();
            return paramContext;
            label12:
            return null;
        } catch (RemoteException paramContext) {
            break label12;
        }
    }

    public int smdtGetScreenHeight(Context paramContext) {
        this.mWindowManager = ((WindowManager) paramContext.getSystemService("window"));
        this.mDisplay = this.mWindowManager.getDefaultDisplay();
        this.mDisplayMetrics = new DisplayMetrics();
        this.mDisplay.getRealMetrics(this.mDisplayMetrics);
        return this.mDisplayMetrics.heightPixels;
    }

    public int smdtGetScreenWidth(Context paramContext) {
        this.mWindowManager = ((WindowManager) paramContext.getSystemService("window"));
        this.mDisplay = this.mWindowManager.getDefaultDisplay();
        this.mDisplayMetrics = new DisplayMetrics();
        this.mDisplay.getRealMetrics(this.mDisplayMetrics);
        return this.mDisplayMetrics.widthPixels;
    }

    public String[] smdtGetSerialPorts() {
        try {
            String[] arrayOfString = this.mService.getSerialPorts();
            return arrayOfString;
        } catch (RemoteException localRemoteException) {
            Log.e("SmdtManager", "RemoteException in getSerialPorts", localRemoteException);
        }
        return null;
    }

    public int smdtGetStatusBar(Context paramContext) {
        try {
            int i = Settings.System.getInt(paramContext.getContentResolver(), "systembar_hide");
            return i;
        } catch (Settings.SettingNotFoundException paramContext) {
            paramContext.printStackTrace();
        }
        return 0;
    }

    public void smdtGetSystemLogcat(String paramString) {
        new SystemLogcat().setupTimer(paramString);
    }

    public String smdtGetUSBPath(Context paramContext, int paramInt) {
        try {
            paramContext = this.mService.smdtGetUSBPath(paramInt);
            return paramContext;
            label13:
            return null;
        } catch (RemoteException paramContext) {
            break label13;
        }
    }

    public int smdtGetVolume(Context paramContext) {
        return ((AudioManager) paramContext.getSystemService("audio")).getStreamVolume(3);
    }

    public int smdtGetfwver(int paramInt) {
        return getfwver(paramInt);
    }

    public void smdtInstallPackage(Context paramContext, File paramFile)
            throws IOException {
        paramFile = paramFile.getCanonicalPath();
        Object localObject = new StringBuilder();
        ((StringBuilder) localObject).append("!!! REBOOTING TO INSTALL ");
        ((StringBuilder) localObject).append(paramFile);
        ((StringBuilder) localObject).append(" !!!");
        Log.w("SmdtManager", ((StringBuilder) localObject).toString());
        localObject = new StringBuilder();
        ((StringBuilder) localObject).append("--update_package=");
        ((StringBuilder) localObject).append(paramFile);
        paramFile = ((StringBuilder) localObject).toString();
        localObject = new StringBuilder();
        ((StringBuilder) localObject).append("--locale=");
        ((StringBuilder) localObject).append(Locale.getDefault().toString());
        localObject = ((StringBuilder) localObject).toString();
        StringBuilder localStringBuilder = new StringBuilder();
        localStringBuilder.append("--update_package=");
        localStringBuilder.append(paramFile);
        localStringBuilder.append("     ");
        localStringBuilder.append("--locale=");
        localStringBuilder.append((String) localObject);
        Log.d("SmdtManager", localStringBuilder.toString());
        bootCommand(paramContext, new String[]{paramFile, localObject});
    }

    public int smdtIoctlDIR(int paramInt) {
        return ioctlDIR(paramInt);
    }

    public int smdtIoctlR() {
        return ioctlR();
    }

    public int smdtIoctlW(int paramInt) {
        return ioctlW(paramInt);
    }

    public long smdtLseek(int paramInt1, long paramLong, int paramInt2) {
        return lseek(paramInt1, paramLong, paramInt2);
    }

    public int smdtMcusetcmd(char paramChar1, char paramChar2, int paramInt) {
        return mcusetcmd(paramChar1, paramChar2, paramInt);
    }

    public int smdtOpen() {
        return open();
    }

    public SmdtSerialPort smdtOpenSerialPort(String paramString, int paramInt)
            throws IOException {
        try {
            Object localObject = this.mService.openSerialPort(paramString);
            if (localObject != null) {
                paramString = new SmdtSerialPort(paramString);
                paramString.open((ParcelFileDescriptor) localObject, paramInt);
                return paramString;
            }
            localObject = new StringBuilder();
            ((StringBuilder) localObject).append("Could not open serial port ");
            ((StringBuilder) localObject).append(paramString);
            throw new IOException(((StringBuilder) localObject).toString());
        } catch (RemoteException paramString) {
            Log.e("SmdtManager", "exception in UsbManager.openDevice", paramString);
        }
        return (SmdtSerialPort) null;
    }

    public String smdtRead(int paramInt1, int paramInt2) {
        return read(paramInt1, paramInt2);
    }

    public byte[] smdtReadExtROM(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
        Object localObject;
        try {
            byte[] arrayOfByte2 = readEeprom(paramInt1, paramInt2, paramInt3, paramInt4);
            byte[] arrayOfByte1 = arrayOfByte2;
            if (arrayOfByte2 == null)
                return null;
        } catch (Exception localObject) {
            localException.printStackTrace();
            localObject = null;
        }
        return localObject;
    }

    public int smdtReadExtrnalGpioValue(int paramInt) {
        return smdtReadGpioValue(paramInt);
    }

    public int smdtReadGpioValue(int paramInt) {
        try {
            paramInt = readGpioValue(paramInt);
            return paramInt;
        } catch (Exception localException) {
            StringBuilder localStringBuilder = new StringBuilder();
            localStringBuilder.append("[getValue] Exception:");
            localStringBuilder.append(localException.toString());
            Log.e("SmdtManager", localStringBuilder.toString());
        }
        return -1;
    }

    public void smdtReboot() {
        Intent localIntent = new Intent("android.intent.action.REBOOT");
        localIntent.putExtra("android.intent.extra.KEY_CONFIRM", false);
        localIntent.setFlags(268435456);
        this.mContext.startActivity(localIntent);
    }

    public void smdtReboot(String paramString) {
        try {
            this.mService.reboot(paramString);
            return;
            label11:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return;
        } catch (RemoteException paramString) {
            break label11;
        }
    }

    public void smdtRebootRecovery() {
        Object localObject1 = new String[7];
        localObject1[0] = "/mnt/internal_sd/update.zip";
        localObject1[1] = "/mnt/external_sd/update.zip";
        localObject1[2] = "/mnt/usb_storage/USB_DISK1/udisk2/update.zip";
        localObject1[3] = "/mnt/usb_storage/USB_DISK1/udisk0/update.zip";
        localObject1[4] = "/mnt/usb_storage/USB_DISK1/udisk1/update.zip";
        localObject1[5] = "/mnt/usb_storage/USB_DISK2/udisk0/update.zip";
        localObject1[6] = "/mnt/usb_storage/USB_DISK0/udisk0/update.zip";
        int i = 0;
        while (i < localObject1.length) {
            if (new File(localObject1[i]).exists())
                try {
                    Object localObject2 = new StringBuilder();
                    ((StringBuilder) localObject2).append("!!! REBOOTING TO INSTALL ");
                    ((StringBuilder) localObject2).append(localObject1[i]);
                    ((StringBuilder) localObject2).append(" !!!");
                    Log.w("SmdtManager", ((StringBuilder) localObject2).toString());
                    localObject2 = new StringBuilder();
                    ((StringBuilder) localObject2).append("--update_package=");
                    ((StringBuilder) localObject2).append(localObject1[i]);
                    localObject1 = ((StringBuilder) localObject2).toString();
                    localObject2 = new StringBuilder();
                    ((StringBuilder) localObject2).append("--locale=");
                    ((StringBuilder) localObject2).append(Locale.getDefault().toString());
                    localObject2 = ((StringBuilder) localObject2).toString();
                    StringBuilder localStringBuilder = new StringBuilder();
                    localStringBuilder.append("--update_package=");
                    localStringBuilder.append((String) localObject1);
                    localStringBuilder.append("     ");
                    localStringBuilder.append("--locale=");
                    localStringBuilder.append((String) localObject2);
                    Log.d("SmdtManager", localStringBuilder.toString());
                    bootCommand(this.mContext, new String[]{localObject1, localObject2});
                    return;
                } catch (IOException localIOException) {
                    localIOException.printStackTrace();
                    return;
                }
            i += 1;
        }
    }

    public Bitmap smdtScreenShot(Context paramContext) {
        this.mDisplayMatrix = new Matrix();
        this.mWindowManager = ((WindowManager) paramContext.getSystemService("window"));
        this.mDisplay = this.mWindowManager.getDefaultDisplay();
        this.mDisplayMetrics = new DisplayMetrics();
        this.mDisplay.getRealMetrics(this.mDisplayMetrics);
        paramContext = new float[2];
        paramContext[0] = this.mDisplayMetrics.widthPixels;
        paramContext[1] = this.mDisplayMetrics.heightPixels;
        int j = this.mDisplay.getRotation();
        String str = SystemProperties.get("persist.sys.hwrotation", "0");
        int i;
        if (!str.equals("270")) {
            i = j;
            if (!str.equals("90")) ;
        } else {
            i = (j + 3) % 4;
        }
        float f = getDegreesForRotation(i);
        if (f > 0.0F)
            i = 1;
        else
            i = 0;
        if (i != 0) {
            this.mDisplayMatrix.reset();
            this.mDisplayMatrix.preRotate(-f);
            this.mDisplayMatrix.mapPoints(paramContext);
            paramContext[0] = Math.abs(paramContext[0]);
            paramContext[1] = Math.abs(paramContext[1]);
        }
        this.mScreenBitmap = SurfaceControl.screenshot((int) paramContext[0], (int) paramContext[1]);
        return this.mScreenBitmap;
    }

    public int smdtSetControl(int paramInt1, int paramInt2) {
        if (paramInt1 == 3) {
            setControl(3, paramInt2);
        } else if (paramInt1 == 4) {
            setControl(4, paramInt2);
        } else if (paramInt1 == 5) {
            setControl(5, paramInt2);
        } else if (paramInt1 == 6) {
            setControl(6, paramInt2);
        } else if (paramInt1 == 7) {
            setControl(7, paramInt2);
        } else if (paramInt1 == 8) {
            setControl(8, paramInt2);
        } else if (paramInt1 == 9) {
            setControl(9, paramInt2);
        } else if (paramInt1 == 10) {
            setControl(10, paramInt2);
        } else if (paramInt1 == 11) {
            setControl(11, paramInt2);
        } else if (paramInt1 == 12) {
            setControl(12, paramInt2);
        } else if (paramInt1 == 13) {
            setControl(13, paramInt2);
        } else if (paramInt1 == 14) {
            setControl(14, paramInt2);
        } else if (paramInt1 == 15) {
            setControl(15, paramInt2);
        } else {
            if (paramInt1 != 16)
                break label218;
            setControl(16, paramInt2);
        }
        return -2;
        label218:
        return -1;
    }

    public void smdtSetEthIPAddress(String paramString1, String paramString2, String paramString3, String paramString4) {
        this.mEthManager = ((EthernetManager) this.mContext.getSystemService("ethernet"));
        this.mStaticIpConfiguration = new StaticIpConfiguration();
        paramString1 = getIPv4Address(paramString1);
        int i = maskStr2InetMask(paramString2);
        paramString2 = getIPv4Address(paramString3);
        paramString3 = getIPv4Address(paramString4);
        this.mStaticIpConfiguration.ipAddress = new LinkAddress(paramString1, i);
        this.mStaticIpConfiguration.gateway = paramString2;
        this.mStaticIpConfiguration.dnsServers.add(paramString3);
        this.mIpConfiguration = new IpConfiguration(IpConfiguration.IpAssignment.STATIC, IpConfiguration.ProxySettings.NONE, this.mStaticIpConfiguration, null);
        this.mEthManager.setConfiguration(this.mIpConfiguration);
    }

    public void smdtSetEthernetState(boolean paramBoolean) {
        IBinder localIBinder = ServiceManager.getService("ethernet");
        if (this.mIEthernetService == null)
            this.mIEthernetService = IEthernetManager.Stub.asInterface(localIBinder);
        if (this.ethernetManager == null)
            this.ethernetManager = new EthernetManager(this.mContext, this.mIEthernetService);
        if (this.ethernetManager == null) {
            Log.i("smdtSetEthernetState==", "null");
            return;
        }
        this.ethernetManager.setEthernetEnabled(paramBoolean);
    }

    public int smdtSetExtrnalGpioValue(int paramInt, boolean paramBoolean) {
        return smdtSetGpioValue(paramInt, paramBoolean);
    }

    public int smdtSetGpioDirection(int paramInt1, int paramInt2) {
        return -1;
    }

    public int smdtSetGpioValue(int paramInt, boolean paramBoolean) {
        throw new RuntimeException("d2j fail translate: java.lang.RuntimeException: can not merge I and Z\r\n\tat com.googlecode.dex2jar.ir.TypeClass.merge(TypeClass.java:100)\r\n\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeRef.updateTypeClass(TypeTransformer.java:174)\r\n\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.copyTypes(TypeTransformer.java:311)\r\n\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.fixTypes(TypeTransformer.java:226)\r\n\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.analyze(TypeTransformer.java:207)\r\n\tat com.googlecode.dex2jar.ir.ts.TypeTransformer.transform(TypeTransformer.java:44)\r\n\tat com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:162)\r\n\tat com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:414)\r\n\tat com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:42)\r\n\tat com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:128)\r\n\tat com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:509)\r\n\tat com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:406)\r\n\tat com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:422)\r\n\tat com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:172)\r\n\tat com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:272)\r\n\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\r\n\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)\r\n\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)\r\n");
    }

    public int smdtSetLcdBackLight(int paramInt) {
        if (paramInt == 1) {
            setBackLight(1);
            return 1;
        }
        if (paramInt == 0) {
            setBackLight(0);
            return 0;
        }
        return -1;
    }

    // ERROR //
    public boolean smdtSetMobileDataEnabled(Context paramContext, boolean paramBoolean) {
        // Byte code:
        //   0: aload_1
        //   1: ldc_w 1029
        //   4: invokevirtual 124	android/content/Context:getSystemService	(Ljava/lang/String;)Ljava/lang/Object;
        //   7: checkcast 1031	android/net/ConnectivityManager
        //   10: astore_1
        //   11: aload_1
        //   12: invokevirtual 1035	java/lang/Object:getClass	()Ljava/lang/Class;
        //   15: invokevirtual 1040	java/lang/Class:getName	()Ljava/lang/String;
        //   18: invokestatic 1044	java/lang/Class:forName	(Ljava/lang/String;)Ljava/lang/Class;
        //   21: ldc_w 1045
        //   24: invokevirtual 1049	java/lang/Class:getDeclaredField	(Ljava/lang/String;)Ljava/lang/reflect/Field;
        //   27: astore_3
        //   28: aload_3
        //   29: iconst_1
        //   30: invokevirtual 1054	java/lang/reflect/Field:setAccessible	(Z)V
        //   33: aload_3
        //   34: aload_1
        //   35: invokevirtual 1057	java/lang/reflect/Field:get	(Ljava/lang/Object;)Ljava/lang/Object;
        //   38: astore_1
        //   39: aload_1
        //   40: invokevirtual 1035	java/lang/Object:getClass	()Ljava/lang/Class;
        //   43: invokevirtual 1040	java/lang/Class:getName	()Ljava/lang/String;
        //   46: invokestatic 1044	java/lang/Class:forName	(Ljava/lang/String;)Ljava/lang/Class;
        //   49: ldc_w 1059
        //   52: iconst_1
        //   53: anewarray 1037	java/lang/Class
        //   56: dup
        //   57: iconst_0
        //   58: getstatic 1065	java/lang/Boolean:TYPE	Ljava/lang/Class;
        //   61: aastore
        //   62: invokevirtual 1069	java/lang/Class:getDeclaredMethod	(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
        //   65: astore_3
        //   66: aload_3
        //   67: iconst_1
        //   68: invokevirtual 1072	java/lang/reflect/Method:setAccessible	(Z)V
        //   71: aload_3
        //   72: aload_1
        //   73: iconst_1
        //   74: anewarray 4	java/lang/Object
        //   77: dup
        //   78: iconst_0
        //   79: iload_2
        //   80: invokestatic 1075	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
        //   83: aastore
        //   84: invokevirtual 1079	java/lang/reflect/Method:invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
        //   87: pop
        //   88: iconst_0
        //   89: ireturn
        //   90: astore_1
        //   91: goto +75 -> 166
        //   94: ldc_w 1059
        //   97: ldc_w 1081
        //   100: invokestatic 793	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
        //   103: pop
        //   104: iconst_0
        //   105: ireturn
        //   106: ldc_w 1059
        //   109: ldc_w 1083
        //   112: invokestatic 793	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
        //   115: pop
        //   116: iconst_0
        //   117: ireturn
        //   118: ldc_w 1059
        //   121: ldc_w 1085
        //   124: invokestatic 793	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
        //   127: pop
        //   128: iconst_0
        //   129: ireturn
        //   130: ldc_w 1059
        //   133: ldc_w 1087
        //   136: invokestatic 793	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
        //   139: pop
        //   140: iconst_0
        //   141: ireturn
        //   142: ldc_w 1059
        //   145: ldc_w 1089
        //   148: invokestatic 793	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
        //   151: pop
        //   152: iconst_0
        //   153: ireturn
        //   154: ldc_w 1059
        //   157: ldc_w 1091
        //   160: invokestatic 793	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
        //   163: pop
        //   164: iconst_0
        //   165: ireturn
        //   166: aload_1
        //   167: athrow
        //   168: astore_1
        //   169: goto -15 -> 154
        //   172: astore_1
        //   173: goto -31 -> 142
        //   176: astore_1
        //   177: goto -47 -> 130
        //   180: astore_1
        //   181: goto -63 -> 118
        //   184: astore_1
        //   185: goto -79 -> 106
        //   188: astore_1
        //   189: goto -95 -> 94
        //
        // Exception table:
        //   from	to	target	type
        //   11	88	90	finally
        //   94	104	90	finally
        //   106	116	90	finally
        //   118	128	90	finally
        //   130	140	90	finally
        //   142	152	90	finally
        //   154	164	90	finally
        //   11	88	168	java/lang/ClassNotFoundException
        //   11	88	172	java/lang/NoSuchFieldException
        //   11	88	176	java/lang/IllegalArgumentException
        //   11	88	180	java/lang/IllegalAccessException
        //   11	88	184	java/lang/NoSuchMethodException
        //   11	88	188	java/lang/reflect/InvocationTargetException
    }

    public int smdtSetPowerOnOff(char paramChar1, char paramChar2, char paramChar3, char paramChar4, char paramChar5) {
        return poweronoff(paramChar1, paramChar2, paramChar3, paramChar4, paramChar5);
    }

    public int smdtSetPwmReg(int paramInt, char paramChar) {
        return setpwmreg(paramInt, paramChar);
    }

    public int smdtSetStatusBar(Context paramContext, boolean paramBoolean) {
        Intent localIntent;
        if (paramBoolean == true) {
            localIntent = new Intent();
            localIntent.setAction("com.smdt.action.displaySystemUI");
            paramContext.sendBroadcast(localIntent);
            return 1;
        }
        if (!paramBoolean) {
            localIntent = new Intent();
            localIntent.setAction("com.smdt.action.hideSystemUI");
            paramContext.sendBroadcast(localIntent);
            return 0;
        }
        return -1;
    }

    public void smdtSetTimingSwitchMachine(String paramString1, String paramString2, String paramString3) {
        try {
            this.mService.smdtSetPowerOffOnAlarm(paramString1, paramString2, paramString3);
            return;
            label13:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return;
        } catch (RemoteException paramString1) {
            break label13;
        }
    }

    public int smdtSetUSBEnable(int paramInt) {
        try {
            paramInt = this.mService.setUSBEnable(paramInt);
            return paramInt;
            label13:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return -1;
        } catch (RemoteException localRemoteException) {
            break label13;
        }
    }

    public int smdtSetUsbPower(int paramInt1, int paramInt2, int paramInt3) {
        StringBuilder localStringBuilder = new StringBuilder();
        localStringBuilder.append("SmdtManager.java==smdtSetUsbPower type:");
        localStringBuilder.append(paramInt1);
        localStringBuilder.append(", num:");
        localStringBuilder.append(paramInt2);
        localStringBuilder.append(", values:");
        localStringBuilder.append(paramInt3);
        Log.i("SmdtManager", localStringBuilder.toString());
        return setUSBPower(paramInt1, paramInt2, paramInt3);
    }

    public boolean smdtSetVolume(Context paramContext, int paramInt) {
        paramContext = (AudioManager) paramContext.getSystemService("audio");
        if ((paramInt >= 0) && (paramInt < 16)) {
            paramContext.setStreamVolume(3, paramInt, 0);
            return true;
        }
        return false;
    }

    public void smdtSilentInstall(String paramString, Context paramContext) {
        try {
            this.mService.smdtSilentInstall(paramString);
            return;
            label11:
            Log.e("SmdtManager", "[getValue] RemoteException");
            return;
        } catch (RemoteException paramString) {
            break label11;
        }
    }

    public void smdtTakeScreenshot(String paramString1, String paramString2, Context paramContext) {
        paramContext = new StringBuilder();
        paramContext.append("screencap -p ");
        paramContext.append(paramString1);
        paramContext.append(paramString2);
        executer(paramContext.toString());
    }

    public String smdtVersion() {
        return version();
    }

    public int smdtWatchDogEnable(char paramChar) {
        return watchDogEnable(paramChar);
    }

    public int smdtWatchDogFeed() {
        return watchDogFeed();
    }

    public int smdtWrite(int paramInt, byte[] paramArrayOfByte) {
        return write(paramInt, paramArrayOfByte);
    }

    public int smdtWriteExtROM(int paramInt1, int paramInt2, int paramInt3, int paramInt4, byte[] paramArrayOfByte) {
        try {
            paramInt1 = writeEeprom(paramInt1, paramInt2, paramInt3, paramInt4, paramArrayOfByte);
            if (paramInt1 == 0)
                return 0;
            return 1;
        } catch (Exception paramArrayOfByte) {
            paramArrayOfByte.printStackTrace();
        }
        return -1;
    }

    public void unmountVolume(String paramString, boolean paramBoolean1, boolean paramBoolean2) {
        Intent localIntent = new Intent();
        localIntent.setAction("com.smdt.unload.storage");
        localIntent.putExtra("path", paramString);
        if (paramBoolean1)
            paramString = "1";
        else
            paramString = "0";
        localIntent.putExtra("force", paramString);
        if (paramBoolean2)
            paramString = "1";
        else
            paramString = "0";
        localIntent.putExtra("removeEncryption", paramString);
        this.mContext.sendBroadcast(localIntent);
    }
}
